The present disclosure generally relates to computer systems and, more particularly, to system and methods for recovering memory for computer systems.
Limited availability of physical memory has brought about different methods of allocating and utilizing physical memory for computer systems. One method deployed by conventional systems includes allocating virtual memory to xe2x80x9cfree upxe2x80x9d physical memory space. The method, called paging, uses a peripheral device, such as a hard disk drive, to provide virtual memory storage. The technique involves providing a virtual address space that is divided into a number of fixed-size blocks called pages. Each page is mapped onto any physical memory address available to a system. During use, a special memory management unit performs an address translation from the virtual address to the system""s physical memory address.
Paging is commonly used by conventional systems to swap pages of information or data between virtual and physical memory locations enabling conventional systems to execute programs and manipulate data files that are larger than the available physical memory. An operating system can copy as much program data or information as possible into physical memory locations while leaving the rest on a hard drive. Therefore, an operating system can address more logical memory than is physically available system.
In some instances, pages or series of pages may be moved between physical memory and storage devices as they are needed during the execution of a program. For example, a xe2x80x9creducexe2x80x9d function for altering the size of a program window may be stored in a virtual memory space, such as a hard drive, and swapped into physical memory when requested by a system. During the swap, the contents within the physical memory locations are copied to a hard drive and the data associated with the xe2x80x9creducexe2x80x9d function is copied into the available physical memory location. In this manner, an operating system can access a storage device when an application requests information or data and exchange pages of data stored in physical memory with information stored within the storage device for freeing up physical memory.
Problems can occur when conventional systems page or swap data in and out of physical memory locations. For example, an application may allocate amounts of memory that do not match the available memory blocks. The system will then split an available block into the size requested and another available block. As this process continues, the available memory blocks tend to decrease in size and become scattered throughout physical memory, causing physical memory to become fragmented. The fragmented physical memory may lead to inefficient use and allocation of the system""s physical memory. As a result, a system may become inefficient due to delays caused by paging information in and out of physical memory in order to free up enough physical memory to execute an application.
Another potential disadvantage of present systems is not deallocating memory upon terminating a process or program. Processes or programs that do not deallocate memory may cause memory leaks thereby causing limited memory availability for subsequent programs or applications.
Some applications reserve and commit memory blocks during execution of the application, increasing requirements for physical memory during operation.
Current systems may also allocate certain pages within a memory block and then deallocate the pages during execution of an application. This allocating and de-allocating of pages cause physical memory to become fragmented. For example, a system may assume that a block of memory that has been allocated is contiguous. However, this may not be the case if only a page or section of memory has been deallocated. This creates fragments within physical memory which lead to both inefficient utilization of memory and potential leakage to subsequent programs or applications.
Therefore, current solutions for managing memory can leave systems with limited amounts of physical memory for executing critical processes such as powering down or suspending a system. Through inefficient allocation of memory and problematic memory leaks, some critical and non-critical processes may improperly execute or unintentionally lock-up a system indefinitely.
In the present disclosure, a system and methods are described for efficient utilization of system memory.
According to one aspect of the present disclosure, a method for recovering physical memory in a computer system having a memory device and an operating system is disclosed. The method includes allocating memory within the system, accessing the recoverable physical memory associated with the allocated memory, and deallocating the allocated memory upon accessing the recoverable physical memory.
According to another aspect of the present disclosure, a method for recovering physical memory associated with a computer system having a memory device and an operating system is disclosed. The method includes detecting an event associated with a process, allocating a portion of the physical memory in response to the event, accessing the allocated portion of physical memory, and deallocating the portion of physical memory.
According to another aspect of the present disclosure, a computer system is disclosed. The system includes at least one processor, at least one storage device, at least one memory device coupled to the processor, and a program of instructions associated with the system. The program of instructions includes at least one instruction to allocate a portion of the memory device in response to an event, at least one instruction to access a memory location associated with the allocated portion of the memory device, and at least one instruction to deallocate the allocated portion of the memory device, wherein the deallocated memory becomes available to be used in association with the event.
According to another aspect of the present disclosure, a method for recovering physical memory within a computer system having a memory device is disclosed. The method includes detecting an event requiring a memory size and allocating memory based upon the detected event. The method also includes accessing at least one portion of physical memory in association with the allocated memory and deallocating the at least one portion of physical memory, wherein the deallocated physical memory operable to be used in association with the event.
One technical advantage of the present disclosure includes providing a system and method for recovering physical memory.
Another technical advantage of the present disclosure includes reducing the effect of memory leaks to subsequent or parallel processes or applications.
A further technical advantage of the present disclosure includes providing a system and methods for increasing availability of physical memory for utilization.